#!/bin/bash

# 后端环境检查脚本

echo "检查后端环境配置..."

# 检查conda
if ! command -v conda &> /dev/null; then
    echo "错误: 未安装conda"
    exit 1
else
    echo "conda已安装"
fi

# 检查CUDA
if ! command -v nvidia-smi &> /dev/null; then
    echo "警告: 未检测到NVIDIA GPU"
else
    echo "GPU信息:"
    nvidia-smi
fi

# 检查Python版本
echo "Python版本:"
python --version

# 检查conda环境
echo "conda环境列表:"
conda env list

# 检查video2text环境
if conda env list | grep -q "video2text"; then
    echo "video2text环境已存在"
    
    # 激活环境并检查依赖
    eval "$(conda shell.bash hook)"
    conda activate video2text
    
    echo "已安装的主要Python包:"
    pip list | grep -E "fastapi|uvicorn|whisper|torch|pytest"
else
    echo "video2text环境不存在"
fi 